Dynomotion

Group: DynoMotion Message: 13717 From: ju1ce89 Date: 9/1/2016
Subject: Rigid Tapping C Program Development

Hi Tom,

I recently started another conversation regarding M codes in KMotionCNC. While I now understand how to get the VARs read into C programs, I have struggled for about a week trying to get my version of a rigid tapping program to work. I started with a program that was posted by Thomas Zamirski on CNC Zone over a year ago. I really liked his idea of taking the dynamic/kinematic behavior of the spindle into account by implementing an 'overshoot compensator,' which includes a deceleration point, as well as a decelerated speed towards the bottom of the cycle to achieve near zero overshoot. 


Since my setup is slightly different from the one Thomas has, I made some changes to his original program (which is also attached for your reference). 
My system uses axis channel 4 (step/dir) to drive a CNC4PC C6 0-10V spindle control board, which is connected to a Hitachi WJ200 VFD driving an industrial inverter motor. There two are I/O bits that control the CW/CCW direction relays of the C6 board; unlike Thomas' setup, I do not have an input that lets KFLOP know that the spindle is safe to reverse or off. I do have a DC resistor installed, which significantly improved the stopping performance of the spindle; I can get very repeatable performance through KFLOP's axis parameters. In order to address the linearity problems in the 0-10V output of the C6 board, I developed an equation for the FACTOR that allows me to get almost perfect closed-loop speed output. As a result, I was able to use the KFLOP axis parameters to calculate my overshoot parameters (OSStop and OSDecel) via the deceleration behavior. I am using axis channel 7 as an input for the 4096 cpr encoder on my spindle.

My current problem is that I cannot get my modified C program to fully execute a tapping cycle. The program begins by starting the spindle at the specified tapping speed (given as S prior to the M Code). Before even reaching the OSDecel point, the spindle is suddently stopped (Console shows 'jogging spindle stop') and the program continues to run, with no output or effect on the machine. Interestingly, there is no code in the rigid tapping program to give this specific output, i.e. no "printf("Jogging Spindle Stop\n");". I added a different number to each command to be able to trace the stopping point, but the only output, in addition to the M Code parameters and Stop/Decel, etc. points, is the initial "Jogging Spindle Stop1", which occurs before the spindle is turned on. While the spindle is running, prior to the unexplained stop, the Z axis does appear to be slaved to the spindle rotation.

Would you be able to take a look at my program and see if there are any obvious problems that could explain the strange behavior I am seeing? Having rigid tapping capability would be a great upgrade to my current setup. Hopefully others will be able to benefit from this thread as well. It does seem to me that there are quite a few people out there with an interest in rigid tapping using a similar VFD/encoder/KFLOP setup.

Thanks,

Julius

 

  @@attachment@@
Group: DynoMotion Message: 13718 From: TKSOFT Date: 9/1/2016
Subject: Re: Rigid Tapping C Program Development [3 Attachments]
Hi Julius,

Do you have the Code to do the Rigid Tapping configured to
Exec/wait/sync for the Tapping to finish before going on and executing
more GCode?

What type of Spindle Control Programs do you have? What messages are in
those?

Regards
TK


On 2016-09-01 11:10, julius.schoop@... [DynoMotion] wrote:
> [Attachment(s) from julius.schoop@... [DynoMotion] included
> below]
>
> Hi Tom,
>
> I recently started another conversation regarding M codes in
> KMotionCNC. While I now understand how to get the VARs read into C
> programs, I have struggled for about a week trying to get my version
> of a rigid tapping program to work. I started with a program that was
> posted by Thomas Zamirski on CNC Zone over a year ago. I really liked
> his idea of taking the dynamic/kinematic behavior of the spindle into
> account by implementing an 'overshoot compensator,' which includes a
> deceleration point, as well as a decelerated speed towards the bottom
> of the cycle to achieve near zero overshoot.
>
> Since my setup is slightly different from the one Thomas has, I made
> some changes to his original program (which is also attached for your
> reference).
> My system uses axis channel 4 (step/dir) to drive a CNC4PC C6 0-10V
> spindle control board, which is connected to a Hitachi WJ200 VFD
> driving an industrial inverter motor. There two are I/O bits that
> control the CW/CCW direction relays of the C6 board; unlike Thomas'
> setup, I do not have an input that lets KFLOP know that the spindle is
> safe to reverse or off. I do have a DC resistor installed, which
> significantly improved the stopping performance of the spindle; I can
> get very repeatable performance through KFLOP's axis parameters. In
> order to address the linearity problems in the 0-10V output of the C6
> board, I developed an equation for the FACTOR that allows me to get
> almost perfect closed-loop speed output. As a result, I was able to
> use the KFLOP axis parameters to calculate my overshoot parameters
> (OSStop and OSDecel) via the deceleration behavior. I am using axis
> channel 7 as an input for the 4096 cpr encoder on my spindle.
>
> My current problem is that I cannot get my modified C program to fully
> execute a tapping cycle. The program begins by starting the spindle at
> the specified tapping speed (given as S prior to the M Code). Before
> even reaching the OSDecel point, the spindle is suddently stopped
> (Console shows 'jogging spindle stop') and the program continues to
> run, with no output or effect on the machine. Interestingly, there is
> no code in the rigid tapping program to give this specific output,
> i.e. no "printf("Jogging Spindle Stop\n");". I added a different
> number to each command to be able to trace the stopping point, but the
> only output, in addition to the M Code parameters and Stop/Decel, etc.
> points, is the initial "Jogging Spindle Stop1", which occurs before
> the spindle is turned on. While the spindle is running, prior to the
> unexplained stop, the Z axis does appear to be slaved to the spindle
> rotation.
>
> Would you be able to take a look at my program and see if there are
> any obvious problems that could explain the strange behavior I am
> seeing? Having rigid tapping capability would be a great upgrade to my
> current setup. Hopefully others will be able to benefit from this
> thread as well. It does seem to me that there are quite a few people
> out there with an interest in rigid tapping using a similar
> VFD/encoder/KFLOP setup.
>
> Thanks,
>
> Julius
>